function Shape() {
}
Shape.prototype.name =	this.name = 'Shape';
<<<<<<< HEAD
Shape.prototype.toString =	this.toString = function (){
=======
Shape.prototype.toString = function (){
>>>>>>> 44619444df529939ad51187fe947e8de892f76a8
		return this.name;
	};

function TwoDShape(){}
var F = function(){};
F.prototype = Shape.prototype;
TwoDShape.prototype = new F();
TwoDShape.prototype.constructor = TwoDShape;
TwoDShape.prototype.name = '2D shape';

function Triangle(side , height){
	this.side = side;
	this.height = height;
}
var F = function(){};
F.prototype = TwoDShape.prototype;
Triangle.prototype  = new F();
Triangle.prototype.constructor = Triangle;
Triangle.prototype.name = 'Triangle';
Triangle.prototype.getArea = function(){
		return this.side * this.height / 2;
};

var my = new Triangle(5,10);
console.log("my.getArea()");
console.log(my.getArea());
console.log("my.toString");
console.log(my.toString());
console.log("my.__proto__ === Triangle.prototype");
console.log(my.__proto__ === Triangle.prototype);
console.log("my.__proto__.constructor === Triangle");
console.log(my.__proto__.constructor === Triangle);
console.log("my.__proto__.__proto__ === TwoDShape.prototype");
console.log(my.__proto__.__proto__ === TwoDShape.prototype);
console.log("my.__proto__.__proto__.__proto__.constructor === Shape" );
console.log(my.__proto__.__proto__.__proto__.constructor === Shape );
